<?php
/* @var $this SettingController */

$this->breadcrumbs=array(
	'Manager Setting'=>array('/settings/manager'),
	'General Setting',
);
?>
<div class="clearfix fix-float-left">
    <?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
    'id'=>'setting-form',
    'enableAjaxValidation'=>true,
    'enableClientValidation'=>true,
    'clientOptions'=>array(
        'validateOnSubmit'=>true,
    )
)); ?>
    <div class="alert alert-info">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <p><strong>
            <span class="icon16  brocco-icon-mic"></span>
            <?php echo t('Fields with <span class="required">*</span> are required.','fcms'); ?>
        </strong></p>
    </div>
    <div class="row-fluid">
        <div class="tabbable"> <!-- Only required for left/right tabs -->
            <ul class="nav nav-tabs">
                <li class="active"><a href="#tab1" data-toggle="tab"><strong><?php echo t('Site','setting'); ?></strong></a></li>
                <li><a href="#tab2" data-toggle="tab"><strong><?php echo t('SEO','setting'); ?></strong></a></li>
                <li><a href="#tab3" data-toggle="tab"><strong><?php echo t('Image','content'); ?></strong></a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="tab1">
                    <fieldset>
                        <legend><?php echo t('Site Settings','setting'); ?></legend>
                        <?php echo $form->textFieldRow($model,'site_name'); ?>
                        <?php echo $form->toggleButtonRow($model,'site_offline',array('class'=>'nostyle')); ?>
                        <?php
                        echo $form->dropDownListRow($model, 'site_offline_message', array(
                                'hide'=>t('Hide','setting'),
                                'custom'=>t('Use Custom Message','setting'),
                            ));
                        ?>
                        <?php echo $form->textAreaRow($model,'site_offline_custom_message'); ?>
                        <?php
                        echo $form->dropDownListRow($model, 'site_default_editor', array(
                                'Tinymce'=>t('TinyMCE','fcms'),
                                'Redactor'=>t('Redactor WYSIWYG','fcms'),
                                'Html5'=>t('Bootstrap WYSIHTML5','fcms'),
                                'CKEditor'=>t('CKEditor WYSIWYG','fcms'),
                                'Markdown'=>t('Markdown Editor','fcms'),
                            ));
                        ?>
                        <?php
                        echo $form->dropDownListRow($model, 'site_page_size', array(
                                5=>5,10=>10,15=>15,20=>20,25=>25,30=>30,50=>50,70=>70,100=>100
                            ));
                        ?>
                    </fieldset>
                </div>
                <div class="tab-pane" id="tab2">
                    <fieldset>
                        <legend><?php echo t('SEO Settings','setting'); ?></legend>
                        <?php echo $form->textFieldRow($model,'site_mainTitle'); ?>
                        <?php echo $form->textFieldRow($model,'site_mainKeyWord'); ?>
                        <?php echo $form->textFieldRow($model,'site_mainDescription'); ?>
                        <?php echo $form->textFieldRow($model,'site_generator'); ?>
                        <?php
                        echo $form->label($model,'site_robots');
                        $this->widget('bootstrap.widgets.TbSelect2', array(
                            'asDropDownList' => false,
                            'form'=>$form,
                            'model'=>$model,
                            'attribute'=>'site_robots',
                            'options'=>array(
                                'tags'=>metaRobots(),
                                'placeholder'=>'Robots',
                                'allowClear'=>true,
                                'width'=>'214px',
                                'maximumSelectionSize'=>1
                            ),
                        ));
                        echo $form->error($model,'site_robots');
                        ?>
                    </fieldset>
                </div>
                <div class="tab-pane" id="tab3">
                    <div class="row-fluid">
                        <div class="span4">
                        <fieldset>
                            <legend><?php echo t('Logo & Icon','setting'); ?></legend>
                        <?php
                        echo $form->label($model,'logo');
                        $this->widget('common.extensions.elfinder.ServerFileInput', array(
                                'model' => $model,
                                'attribute' => 'logo',
                                'showImage'=>true,
                                'htmlOptions'=>array(
                                    'class'=>'nostyle clearfix'
                                ),
                                'connectorRoute' => 'elfinder/connector',
                            )
                        );
                        echo $form->error($model,'logo');
                        ?>
                            <?php
                        echo $form->label($model,'no_image_available');
                        $this->widget('common.extensions.elfinder.ServerFileInput', array(
                                'model' => $model,
                                'attribute' => 'no_image_available',
                                'showImage'=>true,
                                'htmlOptions'=>array(
                                    'class'=>'nostyle clearfix'
                                ),
                                'connectorRoute' => 'elfinder/connector',
                            )
                        );
                        echo $form->error($model,'no_image_available');
                        ?>
                        <?php
                        echo $form->label($model,'icon');
                        $this->widget('common.extensions.elfinder.ServerFileInput', array(
                                'model' => $model,
                                'attribute' => 'icon',
                                'showImage'=>true,
                                'htmlOptions'=>array(
                                    'class'=>'nostyle clearfix'
                                ),
                                'connectorRoute' => 'elfinder/connector',
                            )
                        );
                        echo $form->error($model,'icon');
                        ?>
                        </fieldset>
                        </div>
                        <div class="span4">
                            <fieldset>
                                <legend><?php echo t('Images Dimension','setting'); ?></legend>
                            <?php
                            echo CHtml::label(t('Small Avatar','setting'),'setting'),$form->textField($model,'image_avatar_small_width',array('class'=>'span2')),"<span class='brocco-icon-cancel'></span>",$form->textField($model,'image_avatar_small_height',array('class'=>'span2')),$form->error($model,'image_avatar_small_width'),$form->error($model,'image_avatar_small_height');
                            ?>
                            <?php
                            echo CHtml::label(t('Medium Avatar','setting'),'setting'),$form->textField($model,'image_avatar_medium_width',array('class'=>'span2')),"<span class='brocco-icon-cancel'></span>",$form->textField($model,'image_avatar_medium_height',array('class'=>'span2')),$form->error($model,'image_avatar_medium_width'),$form->error($model,'image_avatar_medium_height');
                            ?>
                            <?php
                            echo CHtml::label(t('Large Avatar','setting'),'setting'),$form->textField($model,'image_avatar_large_width',array('class'=>'span2')),"<span class='brocco-icon-cancel'></span>",$form->textField($model,'image_avatar_large_height',array('class'=>'span2')),$form->error($model,'image_avatar_large_width'),$form->error($model,'image_avatar_large_height');
                            ?>
                            <?php
                            echo CHtml::label(t('Small Thumbnail','setting'),'setting'),$form->textField($model,'image_thumbnail_small_width',array('class'=>'span2')),"<span class='brocco-icon-cancel'></span>",$form->textField($model,'image_thumbnail_small_height',array('class'=>'span2')),$form->error($model,'image_thumbnail_small_width'),$form->error($model,'image_thumbnail_small_height');
                            ?>
                            <?php
                            echo CHtml::label(t('Medium Thumbnail','setting'),'setting'),$form->textField($model,'image_thumbnail_medium_width',array('class'=>'span2')),"<span class='brocco-icon-cancel'></span>",$form->textField($model,'image_thumbnail_medium_height',array('class'=>'span2')),$form->error($model,'image_thumbnail_medium_width'),$form->error($model,'image_thumbnail_medium_height');
                            ?>
                            <?php
                            echo CHtml::label(t('Large Thumbnail','setting'),'setting'),$form->textField($model,'image_thumbnail_large_width',array('class'=>'span2')),"<span class='brocco-icon-cancel'></span>",$form->textField($model,'image_thumbnail_large_height',array('class'=>'span2')),$form->error($model,'image_thumbnail_large_width'),$form->error($model,'image_thumbnail_large_height');
                            ?>
                                </fieldset>
                        </div>
                        <div class="span4">
                            <fieldset>
                                <legend><?php echo t('Features','setting'); ?></legend>
                                <?php echo $form->toggleButtonRow($model, 'image_crop',array('class'=>'nostyle')); ?>
                                <?php echo $form->radioButtonGroupsListRow($model, 'image_watermark',array(0=>t('No Watermark','setting'),1=>t('Text','setting'),2=>t('Image','setting')),array('class'=>'nostyle')); ?>
                                <?php echo $form->textFieldRow($model,'image_watermark_text'); ?>
                                <?php
                                echo $form->label($model,'image_watermark_image');
                                $this->widget('common.extensions.elfinder.ServerFileInput', array(
                                        'model' => $model,
                                        'attribute' => 'image_watermark_image',
                                        'showImage'=>true,
                                        'htmlOptions'=>array(
                                            'class'=>'nostyle clearfix'
                                        ),
                                        'connectorRoute' => 'elfinder/connector',
                                    )
                                );
                                echo $form->error($model,'image_watermark_image');
                                ?>
                            </fieldset>
                        </div>
                        </div>
                </div>
            </div>
        </div>
    </div>
    <div class="form-actions">
        <?php $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType'=>'submit',
        'type'=>'primary',
        'label'=>t('Update','setting'),
    ));
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType'=>'reset',
            'label'=>t('Reset','setting'),
        ));
        ?>
    </div>

    <?php $this->endWidget(); ?>
</div>
